/**
 * 
 */
package switchviz.util;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;


/**
 * @author Thomas
 *
 */
public class Log4jSupport
{
	private static String CONFIGURATION_FILE = "./config/log4j.xml";
	
	private static Log4jSupport instance = new Log4jSupport();
	
	private Log4jSupport()
	{
		DOMConfigurator.configure(CONFIGURATION_FILE);
	}

	public static void initialize()
	{
		getInstance();
	}
	
	public static Log4jSupport getInstance()
	{
		if (instance == null)
			instance = new Log4jSupport();

		return instance;
	}
	
	public void setLogLevel(Level level)
	{
		Logger.getRootLogger().setLevel(level);
	}
	
	public Level getLogLevel()
	{
		return Logger.getRootLogger().getLevel();
	}
}
